<?php
class Link extends AppModel {
	var $name = 'Link';
	var $validate = array(
		'tab_id' => array(
			'numeric' => array(
				'rule' => array('numeric')
			)
		),
		'label' => array(
				'rule' => 'notempty',
				'message' => 'Алиас не может быть пустым'
		),
		'link' => array(
				'rule' => '/(\w+:\/\/)/',
				'message' => 'Ссылка введена некорректно'
		)
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Tab' => array(
			'className' => 'Tab',
			'foreignKey' => 'tab_id',
			'conditions' => '',
			'fields' => '',
			'order' => '',
      'counterCache' => 'links_count'
		)
	);
}
?>